package com.gxan.dao.impl;

import com.gxan.dao.UserDao;
import com.gxan.pojo.SysUser;
import com.gxan.utils.db.JdbcUtils;

import java.sql.SQLException;

public class UserDaoImpl extends JdbcUtils implements UserDao {
    @Override
    public SysUser findUserByUsernameAndPwd(String username, Integer password) throws SQLException {
        String sql = "SELECT * FROM sys_user WHERE login_name=? AND PASSWORD=?";
        Object[] params = {username,password};
        SysUser user=super.queryEntity(SysUser.class,sql,params);
        return user;
    }
//    @Test
//    public void Test() throws SQLException {
//        UserDaoImpl userDao = new UserDaoImpl();
//        System.out.println(userDao.findUserByUsernameAndPwd("admin",123456));
//    }

}
